/*
 * Created on Apr 8, 2010
 */
package com.mgmaps.app;

import com.nutiteq.listeners.ErrorListener;

/**
 * ErrorListener that re-detects blackberry HTTPExtension if a network error occurs 
 *
 * @author CristiS
 * @version 1.0
 */
public class BBRedetectExtension implements ErrorListener {
  private ErrorListener chainedListener;
  
  public BBRedetectExtension() {
  }
  
  public BBRedetectExtension(ErrorListener chainedListener) {
    this.chainedListener = chainedListener;
  }

  public void networkError(String msg) {
    if (APPSettings.isBlackberry && !APPSettings.httpExtensionCustom)
      APPSettings.httpExtension = APPSettings.platformHandler.getBlackberryHTTPExtension();
    if (chainedListener != null)
      chainedListener.networkError(msg);
  }

  public void licenseError(String msg) {
    if (chainedListener != null)
      chainedListener.licenseError(msg);
  }

}
